﻿<%@ Page Language="C#" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="System.Data" %>
<%    OleDbConnection conn = null;
try
{
    string shequs = Request.Params["params"];
    if (shequs == null)
        shequs = "";
    shequs = "'" + shequs.TrimEnd(',').Replace(",","','") + "'";
    conn = DBOp.DbConn;
    OleDbCommand comm = conn.CreateCommand();
    comm.CommandText = "select 社区名, 单位面积电量 as 电量1 from 社区电量统计20072008 where 社区名 in (" + shequs + ")  order by 单位面积电量 desc";
    System.Data.DataTable dt = new System.Data.DataTable();
    OleDbDataAdapter oda = new OleDbDataAdapter(comm);    
    oda.Fill(dt);
    Random r = new Random(0);
     %><chart palette='2' caption='单位面积能耗社区对比2007-2008' showBorder="1" subCaption="（单位：千瓦时）" shownames='1' showvalues='1' formatNumberScale='0' labelDisplay='ROTATE' slantLabels='1'  decimals='2' baseFontSize='12' baseFontFamily='宋体'>

     <%    foreach (DataRow dr in dt.Rows)    {
              
               %><set label='<%=dr["社区名"].ToString() %>' value='<%=dr["电量1"].ToString() %>' isSliced="<%=r.Next(2) %>"/>                                                    
               <% 
          } 
    %>
          <styles>
         <definition>
            <style name='caption' type='font' font='宋体' size='16' color='000000' /> 
            <style name='label' type='font' font='宋体' size='12' Bold='1' color='000000' /> 
         </definition>
         <application>
            <apply toObject='DataLabels' styles='label' />
            <apply toObject='DataValues' styles='label' />
            <apply toObject='Caption' styles='caption' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='Legend' styles='label' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='ToolTip' styles='label' />
         </application>   
    </styles> 
</chart>
<% 
    }    
catch (Exception ex) { 
    %><%=ex.Message %><%=ex.StackTrace %><%
}
    finally{
    if(conn != null)
    conn.Close();} %>